package com.ruoyi.site.mapper;

import java.util.List;
import com.ruoyi.site.domain.UserSubscriptions;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 用户订阅Mapper接口
 *
 * @author chuckeytang
 * @date 2025-10-13
 */
@Mapper
public interface UserSubscriptionsMapper
{
    /**
     * 查询用户订阅
     *
     * @param subscriptionId 订阅ID
     * @return 用户订阅
     */
    public UserSubscriptions selectUserSubscriptionsBySubscriptionId(Long subscriptionId);

    /**
     * 查询用户当前的有效订阅 (用于鉴权)
     *
     * @param userId 用户ID
     * @return 有效订阅记录
     */
    public UserSubscriptions selectActiveSubscriptionByUserId(Long userId);

    /**
     * 查询用户所有订阅列表
     *
     * @param userSubscriptions 用户订阅
     * @return 用户订阅集合
     */
    public List<UserSubscriptions> selectUserSubscriptionsList(UserSubscriptions userSubscriptions);

    /**
     * 新增用户订阅
     *
     * @param userSubscriptions 用户订阅
     * @return 结果
     */
    public int insertUserSubscriptions(UserSubscriptions userSubscriptions);

    /**
     * 修改用户订阅
     *
     * @param userSubscriptions 用户订阅
     * @return 结果
     */
    public int updateUserSubscriptions(UserSubscriptions userSubscriptions);

    /**
     * 删除用户订阅
     *
     * @param subscriptionId 订阅ID
     * @return 结果
     */
    public int deleteUserSubscriptionsBySubscriptionId(Long subscriptionId);

    /**
     * 批量删除用户订阅
     *
     * @param subscriptionIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteUserSubscriptionsBySubscriptionIds(Long[] subscriptionIds);
}